home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -serious- / misc / alockutils / alock-install next >
Text File  |  1999-07-26  |  5KB  |  228 lines

  1. ;------------------------------------------------------------------------
  2. ;
  3. ; $VER: ALock-Install 1.0 (31.7.96)
  4. ;
  5. ; Copyright (c) 1996 Janne Peräaho.
  6. ; All Rights Reserved.
  7. ;
  8. ;------------------------------------------------------------------------
  9.  
  10. ;------------------------------------------------------------------------
  11. ; Prompt texts
  12. ;------------------------------------------------------------------------
  13. ;------------------------------------------------------------------------
  14. ; Help texts
  15. ;------------------------------------------------------------------------
  16.  
  17. ;------------------------------------------------------------------------
  18. ; Install files
  19. ;------------------------------------------------------------------------
  20. ; Check if files installed
  21. (set #alock
  22.     (exists "ETC:passwd"
  23.         (noreq)
  24.     )
  25. )
  26. (if (= #alock 0)
  27.     (
  28.         ; Get etc destination directory
  29.         (set @default-dest
  30.             (askdir
  31.                 (prompt "Select directory for\npasswd, finger.log, and motd files\nDirectory etc will be created")
  32.                 (help "")
  33.                 (default "Boot:")
  34.             )
  35.         )
  36.         ; Store path
  37.         (set #etc (tackon @default-dest "etc"))
  38.  
  39.         ; Create directory etc
  40.         (makedir #etc
  41.             (prompt "Directory etc for\npasswd, finger.log, and motd files will be created")
  42.             (help "")
  43.             (confirm)
  44.         )
  45.  
  46.         ; Make assign
  47.         (makeassign "ETC" #etc)
  48.  
  49.         ; Create passwd file
  50.         (textfile
  51.             (prompt "Creating default password file...")
  52.             (help "")
  53.             (dest "ETC:passwd")
  54.             (append "root,root,System Administrator")
  55.         )
  56.         ; Create finger.log file
  57.         (textfile
  58.             (prompt "Creating finger.log file...")
  59.             (help "")
  60.             (dest "ETC:finger.log")
  61.             (append "")
  62.         )
  63.         ; Install message of today
  64.         ; Enabled?
  65.         (set #motd
  66.             (askchoice
  67.                 (prompt "Message Of Today")
  68.                 (help "")
  69.                 (choices "Disabled" "Enabled")
  70.                 (default 1)
  71.             )
  72.         )
  73.         ; Copy MOTD
  74.         (if(= #motd 0)
  75.             (
  76.                 ; Disabled
  77.                 (copyfiles
  78.                     (prompt "Copying disabled MOTD...")
  79.                     (help "")
  80.                     (source "motd")
  81.                     (dest "ETC:")
  82.                     (newname "disabled_motd")
  83.                     (files)
  84.                 )
  85.             )
  86.             ; Else Enabled
  87.             (
  88.                 (copyfiles
  89.                     (prompt "Copying enabled MOTD...")
  90.                     (help "")
  91.                     (source "motd")
  92.                     (dest "ETC:")
  93.                     (files)
  94.                 )
  95.             )
  96.         )
  97.         ; Set host name
  98.         ; Check if host name exists
  99.         (set #hostname
  100.             (exists "ENVARC:HostName"
  101.                 (noreq)
  102.             )
  103.         )
  104.         (if (= #hostname 0)
  105.             (
  106.                 ; Get hostname
  107.                 (set #hostname
  108.                     (askstring
  109.                         (prompt "\nSet computer name (HostName)")
  110.                         (help "")
  111.                         (default "AMIGA")
  112.                     )
  113.                 )
  114.                 ; Set hostname
  115.                 (textfile
  116.                     (prompt "")
  117.                     (help "")
  118.                     (dest "ENVARC:HostName")
  119.                     (append #hostname)
  120.                 )
  121.                 (textfile
  122.                     (prompt "")
  123.                     (help "")
  124.                     (dest "ENV:HostName")
  125.                     (append #hostname)
  126.                 )
  127.             )
  128.         )
  129.         ; Install ALock
  130.         ; Get commands destination directory
  131.         (set @default-dest
  132.             (askdir
  133.                 (prompt "Select directory for ALock command")
  134.                 (help "")
  135.                 (default "C:")
  136.             )
  137.         )
  138.         (set #commands @default-dest)
  139.         (copyfiles
  140.             (prompt "Copying ALock...")
  141.             (help "")
  142.             (source "ALock")
  143.             (dest #commands)
  144.             (files)
  145.         )
  146.         ; Icon?
  147.         (set #alockicon
  148.             (askchoice
  149.                 (prompt "ALock\nCopy icon?")
  150.                 (help "")
  151.                 (choices "No" "ALock.info")
  152.                 (default 1)
  153.             )
  154.         )
  155.         (if (= #alockicon 0)
  156.             (copyfiles
  157.                 (prompt "Copying icon...")
  158.                 (help "")
  159.                 (source "ALock.info")
  160.                 (dest #commands)
  161.                 (files)
  162.                 (infos)
  163.                 (noposition)
  164.             )
  165.         )
  166.         ; Copy docs
  167.         (set @default-dest
  168.             (askdir
  169.                 (prompt "Select directory for ALock documentation")
  170.                 (help "")
  171.                 (default "HELP:")
  172.             )
  173.         )
  174.         (copyfiles
  175.             (prompt "Copying documentation...")
  176.             (help "")
  177.             (source "Alock.doc")
  178.             (dest @default-dest)
  179.             (files)
  180.         )
  181.     )
  182. )
  183.  
  184. ;------------------------------------------------------------------------
  185. ; Update User-Startup
  186. ;------------------------------------------------------------------------
  187. (set #toustartup
  188.     (askchoice
  189.         (prompt "Insert login procedure to the User-Startup?")
  190.         (help "")
  191.         (choices "No" "Standard" "Expanded")
  192.         (default 2)
  193.     )
  194. )
  195. (select #toustartup
  196.     ; Don't install
  197.     (set #command "")
  198.     ; Standard
  199.     (
  200.         (set #command (cat "ASSIGN ETC: " #etc))
  201.         (set #command (cat #command "\nPATH "))
  202.         (set #command (cat #command #commands))
  203.         (set #command (cat #command " ADD\nALock"))
  204.         (startup "ALock"
  205.             (prompt "\nInserting standard login procedure to the User-Startup...")
  206.             (help "")
  207.             (command #command)
  208.             (confirm)
  209.         )
  210.     )
  211.     ; Expanded
  212.     (
  213.         (set #command (cat "ASSIGN ETC: " #etc))
  214.         (set #command (cat #command "\nPATH "))
  215.         (set #command (cat #command #commands))
  216.         (set #command (cat #command " ADD\nALock\n"))
  217.         (set #command (cat #command "ALockPatch\nFlushLog\nUserStartup"))
  218.         (startup "ALock"
  219.             (prompt "\nInserting expanded login procedure to the User-Startup...")
  220.             (help "")
  221.             (command #command)
  222.             (confirm)
  223.         )
  224.     )
  225. )
  226.  
  227. (set @default-dest #commands)
  228.